<?php

namespace App\Http\Service;

use App\Util\Result;
use App\Model\Member;
use App\Model\MemberBooks;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;

trait ServiceMemberBooks{

    public static function getList($id,$limit){
        $model = DB::table('member_books as a');
        $list = $model
            ->where('a.uid',$id)
            ->leftJoin('Items as b', 'b.SerialNo','=','a.bid')
            ->leftJoin('circ_marc as c','c.MarcID','=','b.MarcID')
            ->select('a.status','c.Title','c.Author','c.Publisher','c.Pages')
            ->paginate($limit);
        return Result::success()->setData($list);
    }

}